﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace DM_Sqlite.Migrations
{
    public partial class firstsqlite : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "dm_props_admin",
                columns: table => new
                {
                    key = table.Column<int>(type: "INTEGER", nullable: false)
                        .Annotation("Sqlite:Autoincrement", true),
                    sample = table.Column<int>(type: "smallint(5)", nullable: false),
                    points = table.Column<int>(type: "smallint(5)", nullable: false),
                    reducetimes = table.Column<int>(type: "tinyint(2)", nullable: false),
                    intervaltime = table.Column<int>(type: "tinyint(2)", nullable: false),
                    logintervaltime = table.Column<int>(type: "smallint(5)", nullable: false),
                    fromemail = table.Column<string>(type: "TEXT", maxLength: 255, nullable: false),
                    smtaddress = table.Column<string>(type: "TEXT", maxLength: 255, nullable: false),
                    smtpport = table.Column<int>(type: "smallint(5)", nullable: false),
                    subject = table.Column<string>(type: "TEXT", maxLength: 255, nullable: false),
                    modeltext = table.Column<string>(type: "TEXT", maxLength: 255, nullable: false),
                    autorizedkey = table.Column<string>(type: "TEXT", maxLength: 255, nullable: false),
                    timespan = table.Column<int>(type: "smallint(5)", nullable: false),
                    accerrorvalue = table.Column<int>(type: "smallint(5)", nullable: false),
                    diserrorvalue = table.Column<int>(type: "smallint(5)", nullable: false),
                    logkeywords = table.Column<string>(type: "TEXT", maxLength: 500, nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_dm_props_admin", x => x.key);
                });

            migrationBuilder.CreateTable(
                name: "dm_props_user",
                columns: table => new
                {
                    key = table.Column<int>(type: "INTEGER", nullable: false)
                        .Annotation("Sqlite:Autoincrement", true),
                    ip = table.Column<string>(type: "TEXT", maxLength: 255, nullable: false),
                    vehicle = table.Column<string>(type: "TEXT", maxLength: 255, nullable: false),
                    watchpath = table.Column<string>(type: "TEXT", maxLength: 500, nullable: false),
                    logpath = table.Column<string>(type: "TEXT", maxLength: 500, nullable: false),
                    echart1chan = table.Column<string>(type: "TEXT", maxLength: 255, nullable: false),
                    echart1title = table.Column<string>(type: "TEXT", maxLength: 255, nullable: false),
                    echart2chan = table.Column<string>(type: "TEXT", maxLength: 255, nullable: false),
                    echart2title = table.Column<string>(type: "TEXT", maxLength: 255, nullable: false),
                    echart3chan = table.Column<string>(type: "TEXT", maxLength: 255, nullable: false),
                    echart3title = table.Column<string>(type: "TEXT", maxLength: 255, nullable: false),
                    echart4chan = table.Column<string>(type: "TEXT", maxLength: 255, nullable: false),
                    echart4title = table.Column<string>(type: "TEXT", maxLength: 255, nullable: false),
                    echart5chan = table.Column<string>(type: "TEXT", maxLength: 255, nullable: false),
                    echart5title = table.Column<string>(type: "TEXT", maxLength: 255, nullable: false),
                    echart6chan = table.Column<string>(type: "TEXT", maxLength: 255, nullable: false),
                    echart6title = table.Column<string>(type: "TEXT", maxLength: 255, nullable: false),
                    remarks = table.Column<string>(type: "TEXT", maxLength: 255, nullable: false),
                    person = table.Column<string>(type: "TEXT", maxLength: 255, nullable: false),
                    email = table.Column<string>(type: "TEXT", maxLength: 255, nullable: false),
                    can0 = table.Column<int>(type: "smallint(5)", nullable: false),
                    idcount = table.Column<int>(type: "smallint(5)", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_dm_props_user", x => x.key);
                });

            migrationBuilder.CreateTable(
                name: "dm_systemversion",
                columns: table => new
                {
                    key = table.Column<int>(type: "INTEGER", nullable: false)
                        .Annotation("Sqlite:Autoincrement", true),
                    version = table.Column<string>(type: "TEXT", maxLength: 255, nullable: false),
                    updatetime = table.Column<DateTime>(type: "datetime", nullable: false),
                    commit = table.Column<string>(type: "TEXT", maxLength: 1000, nullable: false),
                    details = table.Column<string>(type: "TEXT", maxLength: 1000, nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_dm_systemversion", x => x.key);
                });

            migrationBuilder.CreateTable(
                name: "dw_sysauthority",
                columns: table => new
                {
                    key = table.Column<uint>(type: "INTEGER", nullable: false)
                        .Annotation("Sqlite:Autoincrement", true),
                    loginname = table.Column<string>(type: "TEXT", maxLength: 64, nullable: false),
                    password = table.Column<string>(type: "TEXT", maxLength: 64, nullable: false),
                    authoritykey = table.Column<int>(type: "tinyint(1)", nullable: false),
                    avatarpath = table.Column<string>(type: "TEXT", maxLength: 255, nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_dw_sysauthority", x => x.key);
                });
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "dm_props_admin");

            migrationBuilder.DropTable(
                name: "dm_props_user");

            migrationBuilder.DropTable(
                name: "dm_systemversion");

            migrationBuilder.DropTable(
                name: "dw_sysauthority");
        }
    }
}
